package com.ttdev.mmms.service.impl;


import com.ttdev.mmms.entity.StoreInfo;
import com.ttdev.mmms.repository.StoreRepository;
import com.ttdev.mmms.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StoreServiceImpl implements StoreService {

    @Autowired
    private StoreRepository storeRepository;

    // 添加会员
    @Override
    public int addStore(StoreInfo storeManage) {
        return storeRepository.addStore(storeManage);
    }

    // 查询用户密码
    @Override
    public StoreInfo findPwd(String username) {
        return storeRepository.findPwd(username);
    }

    // 查询商家全部信息
    @Override
    public StoreInfo findAll(StoreInfo storeManage) {
        return storeRepository.findAll(storeManage);
    }

    // 查询商店名称是否存在
    @Override
    public Integer selectStoreName(String name) {
        Integer i= storeRepository.selectStoreName(name);
        return i;
    }

    // 查询用户名是否存在
    @Override
    public Integer selectName(String name) {
        Integer i = storeRepository.selectName(name);
//        System.out.println(i);
        return i;
    }


}
